import { Application } from 'egg';

export default (app: Application) => {
  const { controller, router, middleware } = app;

  router.post('/api/safecode', controller.safecode.generate);

  router.post('/api/user/register', controller.user.register);
  router.post('/api/user/gether', controller.user.gether);
  router.post('/api/user/login', controller.user.login);
  router.post('/api/user/logout', middleware.verify(), controller.user.logout);
  router.post('/api/user/detail', middleware.verify(), controller.user.detail);

  router.post('/api/user/near', middleware.verify(), controller.user.near);
  router.post('/api/user/online', middleware.verify(), controller.user.online);

  router.post('/api/active/all', middleware.verify(), controller.active.all);
  router.post('/api/active/share', middleware.verify(), controller.active.share);

  router.post('/api/message/list', middleware.verify(), controller.message.list);
  router.post('/api/message/history', middleware.verify(), controller.message.history);
};
